package cn.itcast.mapper;

import cn.itcast.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * *
 * Created by IntelliJ IDEA.
 * Author: caolei
 * Date: 2018/9/10
 * Time: 20:39
 * *
 */
public interface UserMapper {
    /**
     * 根据id获取用户信息
     * @param id
     * @return
     */
    public User queryUserById(Long id);

    /**
     * 查询所有用户
     * @return
     */
    public List<User> queryUserList();

    /**
     * 新增用户
     * @param user
     */
    public void insertUser(User user);

    /**
     * 更新用户信息
     * @param user
     */
    public void updateUser(User user);

    /**
     * 根据id删除用户信息
     * @param id
     */
    public void deleteUserById(Long id);

    List<User> queryUserListByTableName(@Param("tableName") String tableName);

    User login(@Param("userName")String userName,@Param("password") String password);

    User loginMap(Map<String, String> map);

    User loginUser(User user);

    List<User> queryUserListByUserName(@Param("userName") String userName);


}
